﻿<%@ Page Title="Quản lý Box Sản Phẩm" Language="vb" AutoEventWireup="true" MasterPageFile="~/Master/InSite.Master" CodeBehind="Box.aspx.vb" Inherits="Core.Box" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<fieldset style="width:800px;margin: 0 auto;" id="list">
<asp:Label runat="server" ID="typeID" Visible="false"></asp:Label>
<asp:Label runat="server" ID="typeName" Visible="false"></asp:Label>

<legend><div id="divNavi" runat="server" visible="true"></div></legend>

    <asp:SqlDataSource ID="ds1" runat="server"></asp:SqlDataSource>
    <asp:GridView ID="grid1" runat="server" DataSourceID="ds1" class="tblMain" 
            AutoGenerateColumns="false" GridLines="None" AllowPaging="false" DataKeyNames="BoxID"
            HeaderStyle-BackColor="#9097a9"> 
            <Columns>
                <asp:TemplateField HeaderText="Order" Visible="false">
                    <ItemTemplate>
                        <asp:Label Visible="true" runat="server" ID="lblOrder" Text='<%#Eval("BoxOrder") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="50px" HorizontalAlign="Left" />
                    <ItemStyle Width="50px" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="" ShowHeader="False" HeaderStyle-HorizontalAlign="Left"> 
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgBtnDel" Height="15" runat="server" CommandArgument='<%#Eval("BoxID") %>' CausesValidation="False" CommandName="Cancel" ImageUrl="~/static/inSite/images/cancel.png" CssClass="noneCSS"/>
                    </ItemTemplate> 
                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                    <ItemStyle Width="50px"></ItemStyle>
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="" ShowHeader="False" HeaderStyle-HorizontalAlign="Left"> 
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgBtnUp" Height="15" runat="server" CommandArgument='<%#Eval("BoxID") %>' CausesValidation="False" CommandName="Up" ImageUrl="~/static/inSite/images/up.png" CssClass="noneCSS"/>
                        <asp:ImageButton ID="imgBtnDown" Height="15" runat="server" CommandArgument='<%#Eval("BoxID") %>' CausesValidation="False" CommandName="Down" ImageUrl="~/static/inSite/images/down.png" CssClass="noneCSS"/>
                    </ItemTemplate> 
                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                    <ItemStyle Width="50px"></ItemStyle>
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="No.">
                    <ItemTemplate>
                        <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("BoxID") %>'></asp:Label>
                        <asp:Label Visible="false" runat="server" ID="lbl_ProID" Text='<%#Eval("ProID") %>'></asp:Label>
                        <asp:Label runat="server" ID="lblSTT" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="30px" HorizontalAlign="Left" />
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên SP">
                    <ItemTemplate>
                        <asp:Label ID="lbProName" runat="server" Text='<%#Eval("ProName") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ảnh SP" Visible="true">
                    <ItemTemplate>
                        <asp:Image ID="imgProImage" runat="server" Height="30" ImageUrl='<%#getLinkImg(Eval("ProDate"),Eval("BoxImage"))%>' />
                    </ItemTemplate>
                    <HeaderStyle Width="150px" HorizontalAlign="Left" />
                    <ItemStyle Width="150px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Update Ảnh" Visible="true">
                    <ItemTemplate>
                        <asp:Label ID="lbUpdateImage" runat="server" Text='<%#getLink(Eval("BoxID")) %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="80px" HorizontalAlign="Center" />
                    <ItemStyle Width="80px" HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
        <PagerStyle HorizontalAlign="Center" />
    </asp:GridView>

    <table width="100%" style="margin-top:15px;">
        <tr>
            <td style="width:50px; color: #666666;">
                Tên SP:
            </td>
            <td>
                <asp:TextBox ID="txtProName" class="mediumfield" runat="server"></asp:TextBox>
            </td>
            <td style="width:50px; color: #666666;">
                Mã SP:
            </td>
            <td>
                <asp:TextBox ID="txtProCode" class="smallfield" runat="server"></asp:TextBox>
            </td>
            
            <td>
                <asp:DropDownList ID="cbxMenu" runat="server" CssClass="centerCbx" Visible="true"></asp:DropDownList>
            </td>
            <td style="vertical-align: middle;">
                <asp:Button ID="btnSearch" runat="server" Text="Tìm" class="button" Height="26px" style="margin-top:0px;" AccessKey=""/>
                <asp:Button ID="btnPublish" runat="server" Text="Xuất bản" class="button" Height="26px" style="margin-top:0px;float:none;" />
            </td>
            
        </tr>
    </table>
    <br />
    <asp:Label ID="lbl_ListID" runat="server" Text="" Visible="false"></asp:Label>
    <asp:SqlDataSource ID="ds2" runat="server"></asp:SqlDataSource>
    <asp:GridView ID="grid2" runat="server" class="tblMain" DataSourceID="ds2"
            AutoGenerateColumns="false" GridLines="None" AllowPaging="true" DataKeyNames="ProID" PageSize="10"
            HeaderStyle-BackColor="#9097a9"> 
            <Columns>
                <asp:TemplateField HeaderText="No.">
                    <ItemTemplate>
                        <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("ProID") %>'></asp:Label>
                        <asp:Label Visible="false" runat="server" ID="lbl_Name" Text='<%#Eval("ProName") %>'></asp:Label>
                        <asp:Label Visible="false" runat="server" ID="lbl_Code" Text='<%#Eval("ProCode") %>'></asp:Label>
                        <asp:Label Visible="false" runat="server" ID="lblSubCatID" Text='<%#Eval("SubCatID") %>'></asp:Label>
                        <asp:Label Visible="true" runat="server" ID="lblNo" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                        <asp:Label Visible="false" runat="server" ID="lbStt" Text='<%#Eval("ProStt") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="30px" HorizontalAlign="Left" ForeColor="Black" />
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="" ShowHeader="False" HeaderStyle-HorizontalAlign="Left"> 
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgSelect" Height="15" runat="server" CommandArgument='<%#buildParam(Eval("ProID"), Eval("ProImage2")) %>' CausesValidation="False" CommandName="Up" ImageUrl="~/static/inSite/images/up.png" CssClass="noneCSS"/>
                    </ItemTemplate> 
                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                    <ItemStyle Width="50px"></ItemStyle>
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="Tên SP" SortExpression="ProName">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblProName" Text='<%#Eval("ProName")%>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mã SP" SortExpression="ProName">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblProCode" Text='<%#Eval("ProCode")%>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>            
            </Columns>
        <PagerStyle HorizontalAlign="Center" />
    </asp:GridView>

</fieldset>

</asp:Content>
